GetRange
Returns a Range object that represents the part of the document contained in the specified table.
Syntax
expression.GetRange(Start, End);
expression
- A variable that represents a ApiTable class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
Start | Required | Number | Start position index in the current element. | |
End | Required | Number | End position index in the current element. |
Returns
Example
This example shows how to get a Range object that represents the part of the document contained in the specified table.
let doc = Api.GetDocument();
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
table.SetStyle(tableStyle);
doc.Push(table);
table.GetCell(0, 0).GetContent().GetElement(0).AddText("This is just a sample text.");
let range = table.GetRange(0, 3);
range.SetBold(true);